import WHRequest from "./request";
// import { BASE_URL, TIMEOUT } from "./request/config";

export default new WHRequest({
  //baseURL: "http://47.95.5.193:7029",
  //baseURL: "http://localhost:7029",
  timeout: 100000,
  interceptors: {
    requestInterceptor: (config) => {
      console.log("-----请求成功的拦截-----");
      // const token = cache.getCache("token");
      // if (token) {
      //   config.headers = { Authorization: `Bearer ${token}` };
      // }
      return config;
    },
    requestInterceptorCatch: (err) => {
      console.log("-----请求失败的拦截-----");
      console.log(err);
      return err;
    },
    responseInterceptor: (config) => {
      console.log("-----响应成功的拦截-----");
      return config;
    },
    responseInterceptorCatch: (err) => {
      console.log(err);
      console.log("-----响应失败的拦截-----");
      return err;
    },
  },
});
